package ie.lawlor.amvc.example;
import ie.lawlor.amvc.AmvcApplicationContext;
import ie.lawlor.amvc.patterns.main.MainTriad;

import javax.swing.JFrame;

/**
 * @author blawlor
 * This entire class should be generated from an XML application descriptor. It
 * holds the tree of triads and the application-level messages that they share.
 */
public class Application {

	private static MainTriad getMainTriad() throws Exception{
		initLAF();
		AmvcApplicationContext context = new AmvcApplicationContext();
		return (MainTriad)context.getMainTriad();
	}

	public static void main(String[] args) throws Exception {
//	  com.l2fprod.gui.plaf.skin.Skinit.main(args);
	  MainTriad mainTriad = getMainTriad();
	  JFrame frame = (JFrame)mainTriad.getMainView();
	  frame.pack();
	  mainTriad.start();
	}
	private static void initLAF() throws Exception {
        // Get the look and feel theme pack.
//	    URL themePackURL = MainTriad.class.getResource("/coronaHthemepack.zip");
//	    SkinLookAndFeel.setSkin(
//	    SkinLookAndFeel.loadThemePack(themePackURL));
//	    SkinLookAndFeel.enable();
    }
}
